package com.fowo.api.controller.handleWork;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fowo.api.common.model.R;
import com.fowo.api.model.inventory.list.InventoryListGetInventoryParam;
import com.fowo.api.model.inventory.list.InventoryListGetInventoryResult;
import com.fowo.api.model.inventory.list.InventoryListGetProductParam;
import com.fowo.api.model.inventory.list.InventoryListGetProductResult;
import com.fowo.api.service.impl.InventoryListServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Tag(name = "盘点单")
@RequestMapping("/api/inventory-list")
@RestController
public class InventoryListDController {
    @Resource
    private InventoryListServiceImpl service;

    @Operation(summary = "生成盘点明细")
    @GetMapping("/getInventoryList")
    public R<List<InventoryListGetInventoryResult>> getInventory(InventoryListGetInventoryParam param) {
        return R.data(() -> service.getInventoryList(param));
    }
    @Operation(summary = "选择产品")
    @GetMapping("/getProduct")
    public R<Page<InventoryListGetProductResult>> getProduct(InventoryListGetProductParam param){
        return R.data(() -> service.getProduct(param));
    }

    @Operation(summary = "仓位盘点")
    @GetMapping("/bin/getInventoryList")
    public R<List<InventoryListGetInventoryResult>> getInventoryByBins(String bins,Boolean zeroParticipation){
        return R.data(() -> service.getInventoryByBins(bins,zeroParticipation));
    }

}
